package com.java8;

/**
 * <p>Description: [类功能描述]</p>
 * Created on 2020/12/24
 *
 * @author <a href="mailto: 819712047@qq.com">谢振东 </a>
 * @version 1.0
 */
public class test2 {
    public static void main(String[] args) {
        try {
            test(1);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        try {
            test(2);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        try {
            test(3);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        try {
            test(4);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        try {
            test(5);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
        try {
            test(6);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }

    private static void test(int i) throws Exception {
        try {
            if (i == 1) {
                throw new Exception("i:" + i);
            }
            if (i == 2) {
                throw new Exception("i:" + i);
            }
            if (i == 3) {
                throw new Exception("i:" + i);
            }
            if (i == 4) {
                throw new Exception("i:" + i);
            }
            if (i == 5) {
                throw new Exception("i:" + i);
            }
        } catch (Exception e) {
            throw new Exception("e");
//            throw new Exception("e:" + e.getMessage());
        }
    }


}
